import { t } from 'i18next'
import { Modal } from '@kedacom/react-next'
import shallow from 'zustand/shallow'
import Share from './share'
import { useStore } from './store'
/*
组件的使用
分享弹窗
<ShareModal /> 
*/
const ShareModal = () => {
	const { open, meetingInfo, type, update } = useStore(
		(state) => ({
			open: state.open,
			meetingInfo: state.meetingInfo,
			type: state.type,
			update: state.update,
		}),
		shallow
	)
	const hideShare = () => {
		update({ open: false })
	}
	return (
		<Modal title={t('分享')} width={720} height={440} onCancel={() => hideShare()} needFooter={false} open={open}>
			<Share meetingInfo={meetingInfo} type={type} />
		</Modal>
	)
}
export default ShareModal
